package com.ynny.extends_.example03;

public class Student extends Person{

    private double scoreMath;
    private double scoreMaEn;
    private double scoreMaCh;

    public double getScoreMath() {
        return scoreMath;
    }

    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }

    public double getScoreMaEn() {
        return scoreMaEn;
    }

    public void setScoreMaEn(double scoreMaEn) {
        this.scoreMaEn = scoreMaEn;
    }

    public double getScoreMaCh() {
        return scoreMaCh;
    }

    public void setScoreMaCh(double scoreMaCh) {
        this.scoreMaCh = scoreMaCh;
    }


    public double maxScore(){
        //

        double tempMax = Math.max(scoreMaCh, scoreMaEn);
        double max = Math.max(tempMax, scoreMath);

        return max;
//        System.out.println(max);
    }

    @Override
    public String toString() {
        return "Student{" +
                "scoreMath=" + scoreMath +
                ", scoreMaEn=" + scoreMaEn +
                ", scoreMaCh=" + scoreMaCh +
                "最大值：" + maxScore() +
                '}';
    }
}
